import org.junit.Test;

import java.io.*;

/**
 * @author mubei
 * @date 2021/12/4
 * @description
 */
public class TestSwitch {

    /*
     * 编码产生的问题
     * */
    @Test()
    public void test1() throws Exception {

        String path = "D:\\date\\distable\\practice\\code\\basic\\src\\main\\java\\io\\a.txt";
        BufferedReader br = new BufferedReader(new FileReader(path));
        // 文件是gdk类型的
        // 编码会导致乱码的出现
        System.out.println(br.readLine());

        BufferedReader bs = new BufferedReader(new InputStreamReader(new FileInputStream(path), "gbk"));
        System.out.println(bs.readLine());

    }
}
